<template>
  <div class="app-container">
    <Ht-search-form
      v-show="showSearch"
      :dictMap="dictMapAsync"
      :queryParams="queryParams"
      :outputQueryParams="queryParams"
      :formOptions="formOptions"
      :advOptions="[]"
      :defaultEventKey="defaultEventKey"
      :beforeSearchCallback="false"
      @beforeSearchCallback="beforeSearchCallback"
      :clearCallBack="clearCallBack"
      :labelWidth="75"
    >
      <template slot="endSlotOption">
        <amount-range-search label="金额区间" ref="amountRangeSearch"></amount-range-search>
      </template>
    </Ht-search-form>

    <!--    <div class="page-label-block">-->
    <!--      <span class="color-block">|</span>-->
    <!--      <span class="page-label-name">-->
    <!--      租户管理-->
    <!--      </span>-->
    <!--    </div>-->

    <ht-table
      ref="dataTable"
      :multi-select="false"
      :showSerialNumber="false"
      :dictMap="dictMap"
      :queryParams="queryParams"
      :tableBindColumns="tableBindColumns"
      :opButtonList="opButtonList"
      :reqConfig="regConfig"
      :defaultEventKey="defaultEventKey"
    >
      <template v-slot:operate>
        <el-table-column label="操作" align="left" width="50" fixed="right">
          <template slot-scope="scope">
            <ht-button-group
              :buttonList="[
                {
                  label: '明细',
                  doFunc: () => {
                    handleAction('detail', scope.row);
                  },
                },
              ]"
            />
          </template>
        </el-table-column>
      </template>
    </ht-table>

    <!-- 添加或修改弹出框 -->
    <el-dialog :title="title" center :visible.sync="open" width="1024px" append-to-body :close-on-click-modal="false">
      <el-form ref="detailForm" :model="detailForm" :rules="rules" label-width="140px">
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>支票圈存管理查询</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="交易流水号" prop="id">
                <el-input v-model="detailForm.id" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="报文标识号" prop="pkgId">
                <el-input v-model="detailForm.pkgId" :disabled="true"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="报文类型" prop="pkgNo">
                <el-select
                  style="width: 100%"
                  v-model="
                    detailForm.pkgNo === null || detailForm.pkgNo === undefined
                      ? ''
                      : detailForm.pkgNo + '-' + detailForm.pkgNoDesc
                  "
                  placeholder="报文类型"
                  :disabled="true"
                ></el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="来往账标识" prop="drct">
                <el-select style="width: 100%" v-model="detailForm.drct" placeholder="来往账标识" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.DRCTCODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="内部机构号" prop="brno">
                <el-select style="width: 100%" v-model="detailForm.brno" placeholder="内部机构号" :disabled="true">
                  <el-option
                    v-for="dict in dictMap['Cnaps2Dict.CP2_BRNO']"
                    :key="dict.value"
                    :label="`${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="系统编号" prop="sysCode">
                <el-select style="width: 100%" v-model="detailForm.sysCode" placeholder="系统编号" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.SYSTEMCODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="交易渠道" prop="source">
                <el-select style="width: 100%" v-model="detailForm.source" placeholder="柜面交易" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.TXN_SOURCE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="工作日期" prop="workdate">
                <el-date-picker
                  v-model="detailForm.workdate"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="CPG日期" prop="vdate">
                <el-date-picker
                  v-model="detailForm.vdate"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="发起参与机构号" prop="indirectSender">
                <el-input v-model="detailForm.indirectSender" :disabled="true" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="发起参与机构名称" prop="IndirectSenderName">
                <el-input v-model="detailForm.IndirectSenderName" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="接收参与机构号：" prop="IndirectRecver">
                <el-input v-model="detailForm.IndirectRecver" placeholder="接收参与机构号" :disabled="true"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="接收参与机构名称：" prop="IndirectRecverName">
                <el-input v-model="detailForm.IndirectRecverName" placeholder="接收参与机构名称" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="支票圈存申请解除标识" prop="CheckApplyType">
                <el-select style="width: 100%" v-model="detailForm.CheckApplyType" placeholder="支票圈存申请解除标识" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.CHECK_APPLY_TYPE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="出票日期" prop="issuedate">
                <el-date-picker
                  v-model="detailForm.issuedate"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="支票号码" prop="checkNumber">
                <el-input v-model="detailForm.checkNumber" :disabled="true"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="出票人账号" prop="checkActno">
                <el-input v-model="detailForm.checkActno" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="出票行行号" prop="checkBrno">
                <el-input v-model="detailForm.checkBrno" :disabled="true"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="出票行行名" prop="checkBrname">
                <el-input v-model="detailForm.checkBrname" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="货币币种" prop="curcd">
                <el-select style="width: 100%" v-model="detailForm.curcd" placeholder="货币币种" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.CURCD"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="金额" prop="amount">
                <ht-amount-input v-model="detailForm.amount" placeholder="金额" :disable="true"></ht-amount-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="校验模式" prop="checkMode">
                <el-select style="width: 100%" v-model="detailForm.checkMode" placeholder="校验模式" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.CHECK_MODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <div v-if="this.detailForm.checkMode === 'CD03'">
            <el-row type="flex">
              <el-col :span="24">
                <el-form-item label="校验图像路径" prop="imgFrnData">
                  <el-input type="textarea" v-model="detailForm.imgFrnFileName" :disabled="true" />
                  <el-button type="primary" v-show="detailForm.imgFrnDownload!==undefined&&detailForm.imgFrnDownload!==null"
                             icon="el-icon-search" plain @click="downloadFile(detailForm.imgFrnDownload)">
                    下载
                  </el-button>
                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </el-card>

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>支票圈存管理查询</span>
          </div>

          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="申请备注" prop="remarks">
                <el-input type="textarea" v-model="detailForm.remarks" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="应答状态" prop="bizStatus">
                <el-select style="width: 100%" v-model="detailForm.bizStatus" placeholder="应答状态" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.PROCESSSTATUS"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="业务拒绝处理码" prop="bizRejectCode">
                <el-select
                  style="width: 100%"
                  v-model="
                    detailForm.bizRejectCode === null || detailForm.bizRejectCode === undefined
                      ? ''
                      : detailForm.bizRejectCode + '-' + detailForm.bizRejectCodeDesc
                  "
                  placeholder="业务拒绝处理码"
                  :disabled="true"
                ></el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="业务拒绝信息" prop="bizRejectInfo">
                <el-input type="textarea" v-model="detailForm.bizRejectInfo" maxlength="105" show-word-limit :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="业务处理参与机构号" prop="bizProOrg">
                <el-input v-model="detailForm.bizProOrg" :disabled="true"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="业务处理参与机构名称" prop="bizProOrgname">
                <el-input v-model="detailForm.bizProOrgname" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="应答备注" prop="replayremarks">
                <el-input type="textarea" v-model="detailForm.replayremarks" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="申请业务状态" prop="bizStatus">
                <el-select style="width: 100%" v-model="detailForm.bizStatus" placeholder="申请业务状态" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.TXN_STATUS"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="申请通讯状态" prop="status">
                <el-select style="width: 100%" v-model="detailForm.status" placeholder="申请业务状态" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.PKG_STATUS"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="申请中心状态" prop="procStatus">
                <el-select style="width: 100%" v-model="detailForm.procStatus" placeholder="申请中心状态" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.PROCESSSTATUS"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="申请录入操作员" prop="mdTlrno">
                <el-input v-model="detailForm.mdTlrno" :disabled="true" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="申请录入时间" prop="mdTime">
                <el-date-picker
                  style="width: 100%"
                  v-model="detailForm.mdTime"
                  value-format="yyyyMMddHHmmss"
                  type="datetime"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="申请报文发送时间" prop="sndTime">
                <el-date-picker
                  style="width: 100%"
                  v-model="detailForm.sndTime"
                  value-format="yyyyMMddHHmmss"
                  type="datetime"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="申请报文接收时间" prop="rcvTime">
                <el-date-picker
                  style="width: 100%"
                  v-model="detailForm.rcvTime"
                  value-format="yyyyMMddHHmmss"
                  type="datetime"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="申请通用处理码" prop="procCode">
                <el-input v-model="detailForm.procCode" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="应答交易流水号" prop="replayId">
                <el-input v-model="detailForm.replayId" placeholder="应答交易流水号" :disabled="true"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="应答业务状态" prop="replaybizStatus">
                <el-select style="width: 100%" v-model="detailForm.replaybizStatus" placeholder="应答业务状态" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.TXN_STATUS"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="应答通讯状态" prop="replayStatus">
                <el-select style="width: 100%" v-model="detailForm.replayStatus" placeholder="应答通讯状态" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.PKG_STATUS"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="应答中心状态" prop="replayProcStatus">
                <el-select style="width: 100%" v-model="detailForm.replayProcStatus" placeholder="应答中心状态" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.PROCESSSTATUS"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="应答录入操作员" prop="replaymdTlrno">
                <el-input v-model="detailForm.replaymdTlrno" :disabled="true" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="应答录入时间" prop="replaymdTime">
                <el-date-picker
                  style="width: 100%"
                  v-model="detailForm.replaymdTime"
                  value-format="yyyyMMddHHmmss"
                  type="datetime"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="应答报文发送时间" prop="replaysndTime">
                <el-date-picker
                  style="width: 100%"
                  v-model="detailForm.replaysndTime"
                  value-format="yyyyMMddHHmmss"
                  type="datetime"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="应答报文接收时间" prop="replayrcvTime">
                <el-date-picker
                  style="width: 100%"
                  v-model="detailForm.replayrcvTime"
                  value-format="yyyyMMddHHmmss"
                  type="datetime"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="应答通用处理码" prop="replayprocCode">
                <el-input v-model="detailForm.replayprocCode" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>
      <div slot="footer" class="dialog-footer" align="center">
        <el-button type="primary" @click="cancel">关 闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listPageMixin } from "@/libs/listPageMixin";

import { amountThousandsFormatter } from "@/utils/table_col_formatter";
import HtAmountInput from "@/views/components/HtAmountInput";
import {
  apiUrlConfigQuery,
  checkCircleDepositManagementDownload,
  checkCircleDepositManagementQueryDetail,
} from "@/api/cnaps/beps/418";
import AmountRangeSearch from "@/views/components/AmountSearchInput";
import { baseUrlConfig, downloadfile } from "@/api/authority_app/base";

export default {
  name: "CheckCircleDepositManagementQuery",
  mixins: [listPageMixin],
  components: { HtAmountInput, AmountRangeSearch },
  data() {
    return {
      defaultEventKey: "defaultEventKey",
      // 查询参数
      queryParams: {
        idSeqNo: undefined,
        brno: undefined,
        cpgdate: undefined,
        cpgdate2: undefined,
        workdate: undefined,
        workdate2: undefined,
        amount: undefined,
        amount2: undefined,
      },
      loading: false,
      // 搜索
      formOptions: [],
      //
      searchFormDictList: [
        "Branch",
        "Cnaps2Dict.CP2_BRNO",
        "DRCTCODE",
        "TXN_SOURCE",
        "PROCESSSTATUS",
        "DRCTCODE",
        "SYSTEMCODE",
        "CHECK_APPLY_TYPE",
        "CURCD",
        "CHECK_MODE",
        "TXN_STATUS",
        "PKG_STATUS",
      ],
      // 列信息
      regConfig: apiUrlConfigQuery,
      tableBindColumns: [
        { prop: "id", label: "交易流水号", width: 180 },
        { prop: "brno", label: "内部机构号", dictCode: "Cnaps2Dict.CP2_BRNO", width: 120 },
        { prop: "workdate", label: "工作日期", type: "date", width: 120 },
        { prop: "vdate", label: "CPG日期", type: "date", width: 120 },
        { prop: "indirectSender", label: "发起参与机构号", width: 180 },
        { prop: "indirectRecver", label: "接收参与机构号", width: 180 },
        { prop: "issuedate", label: "出票日期", type: "date", width: 120 },
        { prop: "amount", label: "金额", type: "price", width: 120 },
        { prop: "drct", label: "来往账标识", dictCode: "DRCTCODE", width: 120 },
        { prop: "source", label: "来源", dictCode: "TXN_SOURCE", width: 120 },
        { prop: "procStatus", label: "申请中心状态", dictCode: "PROCESSSTATUS", width: 180 },
      ],
      dictMapAsync: {},
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 表单参数
      detailForm: {
        id: undefined,
        pkgId: undefined,
      },
      totalRecord: 0,
      totalPage: 0,
      needCount: 0,

      rules: {},
    };
  },
  mounted() {
    this.$refs.amountRangeSearch.$on('getAmountRange',this.beforeSearchCallback);

    const formOptions = [
      // 普通搜索

      {
        type: "input",
        prop: "idSeqNo",
        defaultAttr: {
          size: "small",
          label: "交易流水号",
          placeholder: "请输入交易流水号",
        },
      },
      {
        type: "dict",
        dict: "Cnaps2Dict.CP2_BRNO",
        prop: "brno",
        defaultAttr: {
          size: "small",
          label: "内部机构号",
          placeholder: "请输入内部机构号",
        },
      },

      {
        type: "dates",
        nameObj: {
          startTimeName: "cpgdate",
          endTimeName: "cpgdate2",
        },
        defaultAttr: {
          size: "small",
          label: "CPG日期",
          placeholder: ["请输入CPG日期开始", "请输入CPG日期结束"],
          format: "yyyy-MM-dd",
          valueFormat: "yyyyMMdd",
        },
      },
      {
        type: "dates",
        nameObj: {
          startTimeName: "workdate",
          endTimeName: "workdate2",
        },
        defaultAttr: {
          size: "small",
          label: "工作日期",
          placeholder: ["请输入工作日期开始", "请输入工作日期结束"],
          format: "yyyy-MM-dd",
          valueFormat: "yyyyMMdd",
        },
      },
    ];
    this.formOptions = formOptions;
    this.dictMapAsync = this.getDictMap();
  },
  methods: {
    /***
     * 按钮操作汇总
     */
    /***
     * 按钮操作汇总
     */
    handleAction(type, row = {}) {
      switch (type) {
        case "detail":
          this.handleDetail(row);
          break;
      }
    },

    // 关闭按钮
    cancel() {
      this.open = false;
    },

    /** 详情按钮操作 */
    handleDetail(row) {
      checkCircleDepositManagementQueryDetail(row).then((response) => {
        this.title = " 支票圈存管理查询明细";
        this.detailForm = response.result;
        if (this.detailForm.imgFrnData !== undefined) {
          let imgFrnFileName = this.detailForm.imgFrnData.split("||");
          if (imgFrnFileName.length > 1) {
            this.$set(this.detailForm, "imgFrnFileName", imgFrnFileName[1]);
            this.$set(this.detailForm, "imgFrnDownload", this.detailForm.imgFrnData);
          }
        }
        this.open = true;
      });
    },

    download() {
      checkCircleDepositManagementDownload(row).then((response) => {
        this.msgSuccess("下载成功");
        this.open = false;
      });
    },

    beforeSearchCallback() {
      // 搜索按钮之前先执行
      this.queryParams.amount = this.$refs.amountRangeSearch.getAmount1();
      this.queryParams.amount2 = this.$refs.amountRangeSearch.getAmount2();
    },
    clearCallBack() {
      let that = this;
      this.$nextTick(() => {
        this.doQuery(this.defaultEventKey);
      });
      return new Promise(function (resolve, reject) {
        that.$refs.amountRangeSearch.clearAmount();
        that.queryParams.amount = "";
        that.queryParams.amount2 = "";
      });
    },

    downloadFile(fileId) {
      if (fileId !== undefined && fileId !== "") {
        downloadfile(`${baseUrlConfig.downloadFile}`, fileId).then((response) => {
          let blob = new Blob([response.data], { type: "image/jpeg" });
          console.log(response);
          let objectUrl = URL.createObjectURL(blob);
          const link = document.createElement("a"); // 创建a标签
          link.href = objectUrl;
          // const fileNameSplit = response.headers['content-disposition'].split('=')
          // const fileName = decodeURI(fileNameSplit[fileNameSplit.length - 1]) // 跟后端约定好最后一个值为fileName字段
          link.download = fileId.split("||")[1]; // 自定义文件名

          link.click(); // 下载文件
          URL.revokeObjectURL(objectUrl); // 释放内存
        });
      } else {
        this.msgError("下载文件不存在");
      }
    },
  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
